import re
def validate_username_qq(username, qq_number):
    username_pattern = r'^[a-zA-Z0-9_]{6,20}$'
    qq_pattern = r'^[1-9]\d{4,11}$'
    if not re.match(username_pattern, username):
        return "用户名无效，请确保由字母、数字或下划线构成，长度在6到20个字符之间"
    if not re.match(qq_pattern, qq_number):
        return "QQ号无效，请确保是5到12位数字且首位不为0"
    return "用户名和QQ号均有效"

# 测试
username1 = "age12345"
qq_number1 = "8888888"
print(validate_username_qq(username1, qq_number1)) 

username2 = "nb2"
qq_number2 = "88888888"
print(validate_username_qq(username2, qq_number2))